<?php namespace Common\Model;
use Hdphp\Model\Model;
class Address extends Model{
	//指定表名
	protected $table='address';
	//自动验证
	protected $validate=array(
		array('aconsignee','required','收货人不能为空',3,3),
		array('area','required','地区必须选择',3,3)
	);
	public function store(){
	    if(!$this->create()) return false;
	
		$this->data['area']=implode('|', Q('post.area'));
	
		$this->data['user_uid']=$_SESSION['uid'];
//			p($this->data);die;

		$this->add();
		return true;
	}
	
}

 ?>